A state machine is a sequential logic machine that can produce an output based on an input and/or the current state of the machine. The “state” of a state machine may indicate its current operating status. A state machine may output a number of different states based on different inputs. For example, a simple state machine may be a door with two possible states, open and closed. An input to the door may be a command to open or close the door. If the input was a command to open the door, and the current state of the door was closed, the state machine would open the door, and the output would report either that the door was open or that the command to open the door had been issued and that the door was open, depending on which type of state machine had been chosen. State machines may also represent more general logic functions that represent other conditions.
Two types of state machines are Moore state machines and Mealy state machines. A Moore state machine produces an output based on the state of the state machine. The output of the Moore state machine changes when the state transitions. A Mealy state machine produces an output based on the input and the state. The Mealy state machine produces a pulse while the Moore state machine produces a level output. Either type may be used for a variety of applications depending on various design considerations.
State machines may be used for the development of various systems. In the development of these systems, state machines must often be updated in the field using limited programming resources. Available solutions, some of which are described below, have significant drawbacks in terms of ease of programming and speed.
State machines may be implemented used a variety of architectures. Early implementations used discrete circuitry or programmable read only memories (PROMs). These implementations were non-volatile (i.e., they retain their memory, and therefore their programming, when power is removed); however reprogramming these devices to reflect a change in a state machine is a cumbersome and time consuming process.
Newer implementations may use random access memory (RAM) based field programmable gate arrays (FPGAs) which may use a static RAM (SRAM). These implementations were easier to program, but still required dedicated software and additional cost. Also, RAM-based FPGAs are volatile and require an additional non-volatile memory to program the FPGAs when booting. This requirement increases the cost, power consumption, size, and boot time of these implementations. Other implementations include anti-fuse FPGAs, which can only be programmed once.
Flash memories have also been used to implement state machines. Flash memories are nonvolatile, but require an erase state before writing, which greatly increases reprogramming time. Flash memories also require an operating system (OS), which increase access time.
There are continuing efforts to improve the implementation of state machines.